Skip to content

Honor explicit nlsEnabled=false in NVIDIADriver helm template - #3215

Open
Ajax-1 wants to merge 1 commit into
NVIDIA:mainfrom
Ajax-1:fix-helm-nls-enabled-false
Open

Ajax-1 wants to merge 1 commit into
NVIDIA:mainfrom
Ajax-1:fix-helm-nls-enabled-false

Conversation

@Ajax-1

@Ajax-1 Ajax-1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Fixes #3211

Description

templates/nvidiadriver.yaml rendered licensingConfig.nlsEnabled with | default true. Sprig's default treats false as empty, so an explicit driver.licensingConfig.nlsEnabled=false was always rendered as true.

This switches both the secretName and configMapName branches to hasKey, so true is only used when the value is not set at all.

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

Testing

The chart has no template test harness, so I checked the rendered output with helm template:

helm template gpu-operator deployments/gpu-operator --show-only templates/nvidiadriver.yaml \
  --set driver.nvidiaDriverCRD.enabled=true \
  --set driver.licensingConfig.secretName=foo \
  --set driver.licensingConfig.nlsEnabled=false

Before:

  licensingConfig:
    secretName: foo
    nlsEnabled: true

After:

  licensingConfig:
    secretName: foo
    nlsEnabled: false
licensing source nlsEnabled before after
secretName false true false
secretName true true true
secretName unset (=null) true true
configMapName false true false
configMapName true true true

helm lint deployments/gpu-operator passes.


Devin Review

@Ajax-1
Ajax-1 requested a review from a team as a code owner November 10, 2026 08:18
@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

licensingConfig:
secretName: {{ .Values.driver.licensingConfig.secretName }}
nlsEnabled: {{ .Values.driver.licensingConfig.nlsEnabled | default true }}
nlsEnabled: {{ if hasKey .Values.driver.licensingConfig "nlsEnabled" }}{{ .Values.driver.licensingConfig.nlsEnabled }}{{ else }}true{{ end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Empty licensing override breaks driver upgrades

With an empty nlsEnabled override, hasKey renders a blank value instead of the previous true. The NVIDIADriver CRD requires a boolean, so Helm cannot apply the resource.

Learn more

The chart accepts Helm overrides for licensing settings. Helm's --set-string driver.licensingConfig.nlsEnabled= leaves a present key with an empty string, so hasKey takes the value branch and produces nlsEnabled: with a null YAML value. The NVIDIADriver schema requires a boolean. The previous default true treated the empty string as missing and produced valid YAML. Both licensing source branches use the same new expression.

Example: An install with driver.licensingConfig.secretName=license and driver.licensingConfig.nlsEnabled= rendered nlsEnabled: true before this change. On upgrade it renders nlsEnabled: and Kubernetes rejects the NVIDIADriver.

Recommended fix: Preserve false explicitly while treating empty or null overrides as unset in both branches; add render checks for false and empty values.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

licensingConfig:
name: {{ .Values.driver.licensingConfig.configMapName }}
nlsEnabled: {{ .Values.driver.licensingConfig.nlsEnabled | default true }}
nlsEnabled: {{ if hasKey .Values.driver.licensingConfig "nlsEnabled" }}{{ .Values.driver.licensingConfig.nlsEnabled }}{{ else }}true{{ end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Licensing fix lacks a regression test

Both nlsEnabled branches change behavior without a regression test. Automated checks cannot catch a return to rendering explicit false as true.

Learn more

This bug fix changes rendering in both licensing source branches, but the PR contains no new test. Testing conventions explicitly require a regression test that fails without a bug fix, and the chart is the supported installation path.

Example: If either branch reverts to default true, an explicit nlsEnabled=false silently becomes true again; a Helm rendering test that asserts the output for both sources would fail.

Recommended fix: Add automated rendering checks for secretName and configMapName, each with explicit false and default true, and wire them into the repository's test workflow.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

Both licensing configuration branches in the NVIDIADriver template now preserve an explicitly configured nlsEnabled value, including false. When the key is absent, the template renders true.

Severity of issue fixed: Low

Merge Risk: Low · up to a29a1

The licensing fix is mergeable with follow-up; regression tests would guard against restoring the incorrect value.

Architecture risk: Low · up to a29a1

The change affects 1 system.

Changed systems: deployments

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — deployments (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in deployments/gpu-operator/templates/nvidiadriver.yaml: Both the secret-based and ConfigMap-based licensingConfig branches now use hasKey to preserve an explicitly configured nlsEnabled value, including false, and render true only when the key is absent. Previously, both branches used default true.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

Other comments: 1

deployments/gpu-operator/templates/nvidiadriver.yaml: 1

76-76: Minor · Maintainability & Code Quality · Quick win

Add regression tests for both licensing sources.

The PR reports no new test cases. Add rendering tests that set nlsEnabled: false with each of secretName and configMapName. Both tests should fail with the previous default true expression.

Based on learnings, “When fixing a bug, add a regression test that fails without the fix.”

Also applies to: 80-80

Source: Learnings

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0555534 and a29a117.

Files selected for processing: 1

  • deployments/gpu-operator/templates/nvidiadriver.yaml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@JunAr7112 JunAr7112 assigned JunAr7112 and unassigned JunAr7112 Nov 10, 2026
@Ajax-1
Ajax-1 force-pushed the fix-helm-nls-enabled-false branch from a29a117 to eeb6146 Compare November 13, 2026 11:07
The 'default' function treats false as empty, so setting
driver.licensingConfig.nlsEnabled=false always rendered true. Use
hasKey so true is only applied when the value is not set.

Signed-off-by: Ajax-1 <85230126+Ajax-1@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[gpu-op] Helm ignores driver.licensingConfig.nlsEnabled: false in NVIDIADriver template

2 participants